{% load i18n %}
{% load crispy_forms_tags %}
{% for form in form_list %}
  <td class="date-{{ form.instance.date_of_using|date:'Y-m-d' }}"
      data-date_of_using="{{ form.instance.date_of_using|date:'Y-m-d' }}">
    <form onkeydown="if(event.keyCode==13){return false;}"
          name="consumption_form"
          data-is_disabled="{{ form.instance.is_disabled }}"
          data-amount_used="{{ form.instance.amount_used|default_if_none:0 }}"
          data-ingredient_unit_price="{{ form.instance.ingredient.unit_price }}"
          data-date_of_using="{{ form.instance.date_of_using|date:"Y-m-d" }}"
          data-ingredient_meal_type="{{ form.instance.ingredient.meal_type }}"
          {% if form.instance.id %} action="{% url 'canteen:new_consumption' form.instance.id %}" {% else %} action="{% url 'canteen:new_consumption' %}" {% endif %}
          data-ingredient-id="{{ form.instance.ingredient.id }}">
      {% csrf_token %}
      {% for field in form %}{{ field }}{% endfor %}
    </form>
  </td>
{% endfor %}
